import 'package:flutter/material.dart';

class MyHomePage extends StatelessWidget {
  List<String> list = [];

  MyHomePage({super.key}) {
    for (var i = 0; i < 20; i++) {
      list.add("我是第$i条数据");
    }
  }

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
        itemCount: list.length,
        itemBuilder: (context, index) {
          return ListTile(
            title: Text(list[index]),
          );
        });
  }
}
